<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@page import="com.google.gson.JsonArray"%>
<%@page import="com.google.gson.JsonObject"%>

<!DOCTYPE html>
<html lang="en">
<head>
	<%@ include file="/common/common-css.jsp" %>
	<style>
		.table > th {
		  vertical-align: center;
		  background-color: grey;
	}
	</style>		
</head>
<body class="no-skin">
	<div class="page-content">
		<div class="page-content-area">
			<div class="row">
				<div class="col-xs-12 col-sm-12 widget-container-col">
					<div class="widget-box widget-color-blue">
						<!-- #section:custom/widget-box.options.collapsed -->
						<div class="widget-header widget-header-small">
							<h6 class="widget-title lighter">
								<i class="ace-icon glyphicon glyphicon-th-list"></i>品牌信息
							</h6>
                            <div class="widget-toolbar no-border">
								<a href="#" data-action="collapse">
									<i class="ace-icon fa fa-chevron-up"></i>
								</a>
							</div>
						</div>
						
						<div class="widget-body">
							<div class="widget-main" >
								<form id="model" class="form-horizontal"  name="product-form" method="post" >
									<input type="hidden" name="id"  id="id" placeholder="" class="col-xs-12 col-sm-6" value="${paramsMap.activity.id}">
									<div>
										<div style="text-align: left">
											<label for="from">活动名称</label><br>
											<input type="text" name="name"  id="name" placeholder="" class="col-xs-6col-sm-6" value="${paramsMap.activity.activity_name}">
										</div>
										
										<div style="text-align: left">
											<label for="from">备注</label><br>
											<input type="text" name="memo"  id="memo" placeholder="" class="col-xs-6col-sm-6" value="${paramsMap.activity.remark}">
										</div>
									
										<div style="text-align: left">
											<label for="from">选择模板</label><br>
											<s:select id="mid" name="mid" list="%{paramsMap.modelList}" value="%{paramsMap.activity.api_module_id}" listKey="id" listValue="model_name" cssClass="form-control"></s:select>
										</div>
									</div>
								</form>
							</div><!-- /.widget-main -->
						</div><!-- /.widget-body -->
					</div><!-- /.widget-box -->
			 </div><!-- /.col-sm-12 -->
		 </div><!-- /.row -->
			
		<div class="clearfix form-actions">
			<div class="col-md-offset-3 col-md-9">
				<button class="btn  btn-inverse  no-border " onclick="doCancle()" id="delete"> 
					<i class="ace-icon fa fa-undo bigger-160"></i>
					取消
				</button>
				&nbsp; &nbsp; &nbsp;
				<button id="btn-save" name="btn-save" class="btn  btn-success  no-border" type="button" onclick="doSave()">
					<i class="ace-icon fa fa-floppy-o bigger-160"></i>
					保存
				</button>
			</div>
		</div>
	</div>
</div>
<%@ include file="/common/common-js.jsp" %>
<%@ include file="/discovery/maxlength.jsp" %>
<script type="text/javascript" src="${ctx}/js/call_func.js"></script>
<script>

   $(function(){
	   var midVal = $("#midVal").val();
	   if(midVal!=null){
		  $("select[name='mid']")
		    .find("option[value='" + midVal + "']").attr(
				"selected", true);
	   }
    });

	function doCancle(){
		try {
	      	if(parent) {
	        parent.parent['__extdialog_active'].dialog('close');
	      }
	    } catch(e) {
	      window.history.back();
	    }
	}
	
	function deleteSource(row) {
		
		var index = $(row).parent().parent().find('.rowIndex').text();
		var $tr = $("#sourceList tr").eq(index);
		$tr.remove();
		
		$("#sourceList tbody tr .rowIndex").each(function(trindex,tritem){
			$(tritem).text(trindex + 1);
		});
	}


	function doSave() {
		var url=ctx + "/apiactivity/savedActivity.action";
		$("#model").attr("action",url);
		$("#model").submit();
		parent.parent['__extdialog_active'].dialog('close');
	}

</script>	
</body>
</html>
